#include <iostream>
#include <cmath>
#include <cstdio>
#include <algorithm>
using namespace std;
const double inf = 1e20;
const int maxn = 200005;
int n;
struct point
{
    double x, y;
    bool operator<(point p) const
    {
        if (x == p.x)
            return y < p.y;
        return x < p.x;
    }
    point(double x = 0, double y = 0) : x(x), y(y){};
    friend double dis(point p1, point p2)
    {
        return sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));
    }
};
point arr[maxn];
double minDis(int l, int r)
{
    //求出arr[l]...arr[r]之间的最小点对距离
    if (l + 1 == r) //只有一对点
        return dis(arr[l], arr[r]);
    if (r <= l) //当只有一个点或是没有点的时候返回无限大
        return inf;
    //分而治之
    point midPoint = arr[(l + r) / 2];      //获取l..r的中点,并且将其分成两部分
    double d1 = minDis(l, (l + r) / 2);     //左半部分的最小距离
    double d2 = minDis((l + r) / 2 + 1, r); //右半部分的最小距离
    double d = min(d1, d2);                 //取较小的那一个
    //下面开始合并子问题的解
    for (int i = 0; (l + r) / 2 - i >= l; ++i)
    {
        point lp = arr[(l + r) / 2 - i];
        if (lp.x + d >= midPoint.x)
            for (int j = 1; (l + r) / 2 + j <= r; ++j)
            {
                point rp = arr[(l + r) / 2 + j];
                if (rp.x - d <= midPoint.x)
                    d = min(d, dis(lp, rp));
                else
                    break;
            }
        else
            break;
    }
    return d;
}
int main()
{
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        cin >> arr[i].x >> arr[i].y;
    }
    sort(arr, arr + n);
    printf("%.4lf", minDis(0, n - 1));
    return 0;
}